package com.Lyyf.Dao;

import com.Lyyf.Entity.Flower;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FlowerMapper {
    @Select("select * from demo.flowers")
    List<Flower> SelectFlowerAll();
    @Select("select * from demo.flowers where flowerName like '%${flowerName}%'")
    List<Flower> SelectFlowerByName(String flowerName);
    @Select("select * from demo.flowers where flowerId = #{flowerId}")
    Flower SelectFlowerById(int flowerId);
    @Update("update demo.flowers set flowerName = #{flowerName},category = #{category},price = #{price} where flowerId =#{flowerId}")
    int UpdateFlower(Flower flower);
    @Delete("delete from demo.flowers where flowerId = #{flowerId}")
    int DeleteFlower(int flowerId);
    @Insert("insert into demo.flowers (flowerName, category, price) VALUES (#{flowerName},#{category},#{price})")
    int InsertFlower(Flower flower);
}
